package org.emergency.framework.bean;

import java.util.List;

public class PageHelper {

	/**
	 * 分页的list
	 */
	private List list;

	/**
	 * 总数条数
	 */
	private int total;

	/**
	 * 总页数
	 */
	private long totalPage;

	/**
	 * 当前页
	 */
	private int currentPage;

	/**
	 * 每页条目数
	 */
	private int itemNum;

	/**
	 * @return the list
	 */
	public List getList() {
		return list;
	}

	/**
	 * @param list
	 *            the list to set
	 */
	public void setList(List list) {
		this.list = list;
	}

	/**
	 * @return the total
	 */
	public int getTotal() {
		return total;
	}

	/**
	 * @param total
	 *            the total to set
	 */
	public void setTotal(int total) {
		this.total = total;
		totalPage = total % itemNum != 0 ? (total / itemNum + 1)
				: (total / itemNum);
	}

	public long getTotalPage() {
		return totalPage;
	}



	public int getCurrentPage() {
		return currentPage;
	}

	public void setCurrentPage(int currentPage) {
		this.currentPage = currentPage;
	}

	/**
	 * @return the itemNum
	 */
	public int getItemNum() {
		return itemNum;
	}

	/**
	 * @param itemNum
	 *            the itemNum to set
	 */
	public void setItemNum(int itemNum) {
		this.itemNum = itemNum;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "PageHelper [list=" + list + ", total=" + total + ", totalPage="
				+ totalPage + ", currentPage=" + currentPage + ", itemNum="
				+ itemNum + "]";
	}

	public void setTotalPage(long totalPage) {
		this.totalPage = totalPage;
	}

}
